package org.lee.android;
import java.util.Date;

import com.tencent.tendon.convert.json.JsonConvert;
public class OddsInfo {    
	        public String mId;
	        public String sId;
	        public String oType;
	        public String host;
	        public String vs;
	        public String visit;
	        public String hostF;
	        public String vsF;
	        public String visitF;

	        public Date chgTime;
	        public OddsInfo()
	        {
	            mId = "";
	            sId = "";
	            oType = "";
	            host = "";
	            vs = "";
	            visit = "";
	            hostF = "";
	            vsF = "";
	            visitF = "";
	        }
	        public OddsInfo(String oddsinfo)
	        {
	        	Object[] infoArr = oddsinfo.split(OddsUntil.SplitColumn);
	            this.mId = infoArr[0].toString();
	            this.sId = infoArr[1].toString();
	            this.oType = infoArr[2].toString();
	            this.host = infoArr[3].toString();
	            this.vs = infoArr[4].toString();
	            this.visit = infoArr[5].toString();
	            this.hostF = infoArr[6].toString();
	            this.vsF = infoArr[7].toString();
	            this.visitF = infoArr[8].toString();

	            
	        }
	        public String getOdds(int idx) 
	        {
	            if (idx == 1)
	                return this.host;
	            else if (idx == 2)
	                return this.vs;
	            else if (idx == 3)
	                return this.visit;
	            else if (idx == 4)
	                return this.hostF;
	            else if (idx == 5)
	                return this.vsF;
	            else if (idx == 6)
	                return this.visitF;
	            return "";

	        }
	        public void setOdds (int idx,String value) 
	        {

	            if (idx == 1)
	                this.host = value;
	            else if (idx == 2)
	                this.vs = value;
	            else if (idx == 3)
	                this.visit = value;
	            else if (idx == 4)
	                this.hostF = value;
	            else if (idx == 5)
	                this.vsF = value;
	            else if (idx == 6)
	                this.visitF = value;

	        }

	        public static String toJson(OddsInfo odds)
	        {
	            String json = JsonConvert.convertTo(odds);
	            return json;
	            
	        }
	        public static OddsInfo fromJson(String jsondata)
	        {
	            OddsInfo oddsinfo = JsonConvert.convertFrom(jsondata,null);
	            return oddsinfo;
	        }
	    }

